home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 36 / vfos_dv.zip / MACROS.INC < prev    next >
Text File  |  1988-10-26  |  7KB  |  185 lines

  1. ;
  2. ; VFOS_IBM VFOSSIL driver by Bob Hartman  (SysOp of 1:132/101).
  3. ; Copyright 1988 by Spark Software.  ALL RIGHTS RESERVED.
  4. ;
  5.  
  6. Enter_Vio macro
  7.  
  8.         push    bp
  9.         mov     bp,sp
  10.         push    bx
  11.         push    cx
  12.         push    dx
  13.         push    si
  14.         push    di
  15.         push    ds
  16.         push    es
  17.  
  18.         push    cs
  19.         pop     ds
  20.  
  21.         endm
  22.  
  23. Exit_Vio macro  functype,numret
  24.  
  25. f&functype&_out:
  26.         pop     es
  27.         pop     ds
  28.         pop     di
  29.         pop     si
  30.         pop     dx
  31.         pop     cx
  32.         pop     bx
  33.         mov     sp,bp
  34.         pop     bp
  35.         ret     numret
  36.  
  37.         endm
  38.  
  39. Locate_Cursor macro functype
  40.  
  41.         mov     ah,2                    ; set cursor call
  42.         push    si                      ; save pointer
  43.         int     10h                     ; dx already set, so go ahead
  44.         pop     si                      ; get pointer back
  45.         inc     dl                      ; increment column count
  46.         cmp     dl,79                   ; is it too high
  47.         jle     f&functype&_10          ; it is ok
  48.         sub     dl,80                   ; subtract the 80 columns
  49.         inc     dh                      ; increment the row
  50.  
  51. f&functype&_10:
  52.  
  53.         endm
  54.  
  55. Check_Handle macro functype
  56.  
  57.         mov     ax,[bp+6]               ; get handle
  58.         or      ax,ax                   ; is it zero
  59.         jz      f&functype&_1           ; it is ok
  60.         mov     ax,436                  ; bad handle
  61.         jmp     f&functype&_out         ; return
  62.  
  63. f&functype&_1:
  64.  
  65.         endm
  66.  
  67. Do_Row_Col macro functype,row,col
  68.  
  69. IFDEF DIRECT
  70.  
  71.         mov     ax,[bp+row]             ; get row
  72.         cmp     ax,0                    ; is it less than 0
  73.         jae     f&functype&_2           ; ok so far
  74.         mov     ax,358                  ; bad row
  75.         jmp     f&functype&_out         ; get out
  76. f&functype&_2:
  77.         cmp     ax,24                   ; is it greater than 24
  78.         jbe     f&functype&_3           ; ok so far
  79.         mov     ax,358                  ; bad row
  80.         jmp     f&functype&_out         ; get out
  81. f&functype&_3:
  82.         mov     cl,5
  83.         shl     ax,cl                   ; multiply by 32
  84.         mov     di,ax                   ; save this
  85.         shl     ax,1                    ; multiply by 64
  86.         shl     ax,1                    ; multiply by 128
  87.         add     di,ax                   ; add it in, now it is a total of 160x
  88.         mov     ax,[bp+col]             ; get column
  89.         cmp     ax,0                    ; is it less than 0
  90.         jae     f&functype&_4           ; ok so far
  91.         mov     ax,359                  ; bad column
  92.         jmp     f&functype&_out         ; get out
  93. f&functype&_4:
  94.         cmp     ax,79                   ; is it greater than 79
  95.         jbe     f&functype&_5           ; ok so far
  96.         mov     ax,359                  ; bad column
  97.         jmp     f&functype&_out         ; get out
  98. f&functype&_5:
  99.         shl     ax,1                    ; multiply by 2
  100.         add     di,ax                   ; add in the column offset
  101.  
  102. ELSE
  103.  
  104.         mov     ax,[bp+row]             ; get row
  105.         cmp     ax,0                    ; is it less than 0
  106.         jae     f&functype&_2           ; ok so far
  107.         mov     ax,358                  ; bad row
  108.         jmp     f&functype&_out         ; get out
  109. f&functype&_2:
  110.         cmp     ax,24                   ; is it greater than 24
  111.         jbe     f&functype&_3           ; ok so far
  112.         mov     ax,358                  ; bad row
  113.         jmp     f&functype&_out         ; get out
  114. f&functype&_3:
  115.         mov     dh,al                   ; save this
  116.         mov     ax,[bp+col]             ; get column
  117.         cmp     ax,0                    ; is it less than 0
  118.         jae     f&functype&_4           ; ok so far
  119.         mov     ax,359                  ; bad column
  120.         jmp     f&functype&_out         ; get out
  121. f&functype&_4:
  122.         cmp     ax,79                   ; is it greater than 79
  123.         jbe     f&functype&_5           ; ok so far
  124.         mov     ax,359                  ; bad column
  125.         jmp     f&functype&_out         ; get out
  126. f&functype&_5:
  127.         mov     dl,al                   ; add in the column offset
  128.         mov     bh,0                    ; set current page
  129.         mov     ah,2                    ; do a set cursor call
  130.         int     10h                     ; move the cursor there
  131.  
  132. ENDIF
  133.  
  134.         endm
  135.  
  136. Scroll_Stuff macro functype,scrltype
  137.  
  138.         mov     ax,[bp+20]              ; get top row
  139.         mov     ch,al                   ; put in place
  140.         mov     ax,[bp+18]              ; get left column
  141.         mov     cl,al                   ; put in place
  142.         mov     ax,[bp+16]              ; get bottom row
  143.         mov     dh,al                   ; put in place
  144.         mov     ax,[bp+14]              ; get right column
  145.         mov     dl,al                   ; put in place
  146.         lds     si,[bp+8]               ; get pointer to cell
  147.         lodsw                           ; get the cell to use
  148.         mov     bh,ah                   ; put attribute in place
  149.         mov     ax,[bp+12]              ; get lines to scroll
  150.         or      ax,ax                   ; is it 0?
  151.         jne     f&functype&_20          ; no, so go on
  152.         mov     ax,0                    ; nothing to do, so return good
  153.         jmp     f&functype&_out         ; go away
  154.  
  155. f&functype&_20:
  156.         cmp     ax,-1                   ; if it is -1, make it 0
  157.         jne     f&functype&_21          ; its not, so go on
  158.         xor     ax,ax                   ; make it 0
  159.  
  160. f&functype&_21:
  161.         mov     ah,scrltype             ; scroll down BIOS call
  162.         int     10h                     ; do the call
  163.  
  164.         endm
  165.  
  166. ;* This macro is an addition by David Page, used to implement support
  167. ;* for DESQview, especially with X00
  168.  
  169. DESQview_shadow macro
  170.  
  171.         push  di              ;setup for DESQview shadow call
  172.         push  es              ;which is safe even if DV not there
  173.         mov   ax,adapter_base ;get current adapter base
  174.         mov   es,ax           ;and put it in es
  175.         mov   ah,0feH         ;code for SHADOW call, invalid if DV not there
  176.         mov   di,0            ;offset always 0
  177.         int   10H             ;ignored by DOS if DV not there
  178.         mov   ax,es           ;retrieve the adapter base
  179.         mov   adapter_base,ax ;and store it
  180.         pop   es
  181.         pop   di
  182.  
  183.         endm
  184.  
  185.